import time
from selenium import webdriver
d=webdriver.Chrome()
d.maximize_window()
d.get('https://test.rabbitpre.com/')
d .find_element_by_id('g-j-signin-btn').click()
d .switch_to.frame('sso')
d .find_element_by_xpath('/html/body/div[1]/div/div[2]/div[1]/span[2]').click()
d .find_element_by_xpath('/html/body/div[1]/div/div[2]/div[3]/div[1]/input').send_keys('18544444444')
d .find_element_by_xpath('/html/body/div[1]/div/div[2]/div[3]/div[2]/input').send_keys('123456')
d .find_element_by_xpath('/html/body/div[1]/div/div[2]/div[3]/button').click()
time.sleep(1)
d.get('https://editor.test.rabbitpre.com/')
time.sleep(3)

from selenium.webdriver.common.action_chains import ActionChains

# 定位编辑器上鼠标悬停“互动”
mouse = d.find_element_by_link_text("互动")
ActionChains(d).move_to_element(mouse).perform()
#选中按钮组件
d.find_element_by_xpath('//*[@id="editor"]/section/header/nav/a[6]/ul/section[1]/ul/li[2]/div/span').click()
time.sleep(1)
# 发布
d.find_element_by_xpath('//*[@id="editor"]/section/header/div/nav/button[2]/span[2]').click()